package com.oc.mba.entity;

import java.util.List;

import com.oc.mba.presist.Paper;

public class PaperJsonEntity {
	/** 试卷ID **/
	private Long paperId;
	/** 试卷类型 **/
	private int type;
	/** 类型标题 **/
	private String typeTitle;
	
	/** 试卷名称 **/
	private String title;
	
	/** 试卷描述 **/
	private String describe;
	
	/** 创建者 **/
	private String creator;
	
	/** 试题数 **/
	private int topicCount;
	
	/** 价格 **/
	private float price;
	
	/** 是否已经购买 **/
	private boolean purchased;

	private List<TopicJsonEntity> topics;

	public Long getPaperId() {
		return paperId;
	}

	public void setPaperId(Long paperId) {
		this.paperId = paperId;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getTypeTitle() {
		return typeTitle;
	}

	public void setTypeTitle(String typeTitle) {
		this.typeTitle = typeTitle;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public int getTopicCount() {
		return topicCount;
	}

	public void setTopicCount(int topicCount) {
		this.topicCount = topicCount;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public boolean isPurchased() {
		return purchased;
	}

	public void setPurchased(boolean purchased) {
		this.purchased = purchased;
	}

	public List<TopicJsonEntity> getTopics() {
		return topics;
	}

	public void setTopics(List<TopicJsonEntity> topics) {
		this.topics = topics;
	}

	public Paper transform() {
		Paper paper = new Paper();
		paper.setCreator(creator);
		paper.setType(type);
		paper.setTypeTitle(typeTitle);
		paper.setDescribe(describe);
		paper.setPaperId(paperId);
		paper.setPrice(price);
		paper.setPurchased(purchased);
		paper.setTitle(title);
		paper.setTopicCount(topicCount);
		return paper;
	}

	public void transform(Paper paper) {
		paper.setCreator(creator);
		paper.setType(type);
		paper.setTypeTitle(typeTitle);
		paper.setDescribe(describe);
		paper.setPaperId(paperId);
		paper.setPrice(price);
		paper.setPurchased(purchased);
		paper.setTitle(title);
		paper.setTopicCount(topicCount);
	}
	
}
